{template '_header'}
<div class="page-heading">
    <h2><i class="fa fa-circle-o"></i>自定义菜单设置</h2>
</div>

<form action="" {ifp 'diypage.shop.menu.save'}method="post"{/if} class="form-horizontal form-validate">

    <div class="alert alert-danger">注意：商城页面如果是diy页面，自定义菜单请至diy页面编辑中设置。</div>

    <div class="form-group">
        <label class="col-sm-2 control-label">商城菜单</label>
        <div class="col-sm-9 col-xs-12">
            <div class="input-group">
                <div class="input-group-addon">微信端</div>
                <select class="form-control valid"{ifp 'diypage.shop.menu.save'}name="menu[shop]"{else}readonly{/if}>
                    <option value="">系统默认</option>
                    {loop $list $item}
                        <option value="{$item['id']}" {if $data['menu']['shop']==$item['id']}selected="selected"{/if}>{$item['name']}</option>
                    {/loop}
                </select>
                <div class="input-group-addon" style="border-left: 0; border-right: 0">WAP端</div>
                <select class="form-control valid"{ifp 'diypage.shop.menu.save'}name="menu[shop_wap]"{else}readonly{/if}>
                    <option value="">系统默认</option>
                    {loop $list $item}
                        <option value="{$item['id']}" {if $data['menu']['shop_wap']==$item['id']}selected="selected"{/if}>{$item['name']}</option>
                    {/loop}
                </select>
            </div>
        </div>
    </div>

    {if $_W['plugin']!='merch' && !isset($_W['merch'])}

        {loop $pluginList $plugin $status}
            {if !empty($status) && p($plugin)}
                <div class="form-group">
                    <label class="col-sm-2 control-label">{php echo m('plugin')->getName($plugin)}</label>
                    <div class="col-sm-9 col-xs-12">
                        <div class="input-group">
                            <div class="input-group-addon">微信端</div>
                            <select class="form-control valid"{ifp 'diypage.shop.menu.save'}name="menu[{$plugin}]"{else}readonly{/if}>
                                <option value="">系统默认</option>
                                {loop $list $item}
                                    <option value="{$item['id']}" {if $data['menu'][$plugin]==$item['id']}selected="selected"{/if}>{$item['name']}</option>
                                {/loop}
                            </select>
                            <div class="input-group-addon" style="border-left: 0; border-right: 0">WAP端</div>
                            <select class="form-control valid"{ifp 'diypage.shop.menu.save'}name="menu[{$plugin}_wap]"{else}readonly{/if}>
                                <option value="">系统默认</option>
                                {loop $list $item}
                                    <option value="{$item['id']}" {if $data['menu'][$plugin.'_wap']==$item['id']}selected="selected"{/if}>{$item['name']}</option>
                                {/loop}
                            </select>
                        </div>
                    </div>
                </div>
            {/if}
        {/loop}

    {/if}

    {ifp 'diypage.shop.menu.save'}
        <div class="form-group">
            <label class="col-sm-2 control-label"></label>
            <div class="col-sm-9 col-xs-12">
                <input type="submit" value="提交" class="btn btn-primary">
            </div>
        </div>
    {/if}

</form>
{template '_footer'}